package com.sky.mapper;

import com.sky.dto.EmployeeDTO;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.dto.PasswordEditDTO;
import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /**
     * 添加员工
     * @param employee
     */
    void insertEmp(Employee employee);

    /**
     * 分页查询员工
     * @param employeePageQueryDTO
     */
    List<Employee> StaffPaginationSearch(@Param("employeePageQueryDTO") EmployeePageQueryDTO employeePageQueryDTO);

    /**
     * 修改员工账号状态
     * @param status
     * @param id
     */
    void ModificationEmpState(String status, Integer id);

    /**
     * 根据id查询员工
     * @param id
     * @return
     */
    Employee IDQueryingEmp(String id);

    /**
     * 修改员工信息
     * @param employeeDTO
     */
    void EditorialStaff(@Param("employeeDTO") EmployeeDTO employeeDTO);

    /**
     * 修改密码
     * @param passwordEditDTO
     */
    void ModificationPassword(PasswordEditDTO passwordEditDTO);

    /**
     * 用于修改密码获取的数据库旧密码
     * @param empId
     * @return
     */
    String EmpPassword(Long empId);
}
